package tcln.sors.model.core.util.dataloader;

import tcln.sors.model.contact.dom.Contact;
import tcln.sors.model.order.dom.Order;
import tcln.sors.model.order.dom.OrderItem;
import tcln.sors.model.order.dom.OrderItemHist;
import tcln.sors.model.product.dom.Product;
import tcln.sors.model.product.dom.ProductSpecProperty;
import tcln.sors.model.product.dom.ProductSpecification;

/**
 * @author Truong Chau Lien Ngoc (lienngoc@gmail.com)
 */
public class DataCleanupCommand extends DataLoadingCommand {

    /**
     * {@inheritDoc}
     */
    @Override
    protected void doExecute(Object input, Object[] additionalParams) {
        getDaoFactory().getDaoFor(OrderItemHist.class).deleteAllNoCascade();
        getDaoFactory().getDaoFor(OrderItem.class).deleteAllNoCascade();
        getDaoFactory().getDaoFor(Order.class).deleteAllNoCascade();
        getDaoFactory().getDaoFor(Contact.class).deleteAllNoCascade();
        getDaoFactory().getDaoFor(Product.class).deleteAllNoCascade();
        getDaoFactory().getDaoFor(ProductSpecProperty.class).deleteAllNoCascade();
        getDaoFactory().getDaoFor(ProductSpecification.class).deleteAllNoCascade();
    }

}
